package org.hy.pay.message.api;

import java.util.Map;

import org.hy.pay.common.core.exception.BizException;
import org.hy.pay.common.core.page.PageBean;
import org.hy.pay.common.core.page.PageParam;
import org.hy.pay.message.entity.RpTransactionMessage;
import org.hy.pay.message.exception.MessageBizException;

public interface RpTransactionMessageService {
	/**
	 * 预存消息
	 */
	public int saveMessageWaitingConfirm(RpTransactionMessage rpTransactionMessage) throws MessageBizException;
	/**
	 * 确认并发送信息
	 */
	public void confirmAndSendMessage(String messageId) throws MessageBizException;
    /**
     * 存储并发送消息
     * @return
     */
	public int saveAndSendMessage(RpTransactionMessage rpTransactionMessage) throws MessageBizException;
	/**
	 * 直接发送消息
	 */
	public void directSendMessage(RpTransactionMessage rpTransactionMessage) throws MessageBizException;
	/**
	 * 重新发送消息
	 */
	public void reSendMessage(RpTransactionMessage rpTransactionMessage) throws MessageBizException;
	/**
	 * 根据messageId 重新发送消息
	 */
	public void reSendMessageByMessageId(String messageId) throws MessageBizException;
	/**
	 * 将消息标志位死亡
	 */
	public void setMessageToAreadlyDead(String messageId) throws MessageBizException;
	/**
	 * 查询消息
	 */
	public RpTransactionMessage getMessageByMessageId(String messageId) throws MessageBizException;
	/**
	 * 删除消息
	 */
	public void deleteMessageById(String messageId) throws MessageBizException;
	/**
	 * 重新发送消息队列中已经死亡的消息
	 */
	public void reSendAllDeadMessageByQueueName(String queueName,int batchSize) throws MessageBizException;
	
	/**
	 * 获得分页数据
	 * @return
	 */
	PageBean listPage( PageParam pageParam,Map<String,Object> paramMap);

}
